#include <asm.h>
#include <regdef.h>
#include <inst_test.h>

LEAF(n47_bltz_test)
    .set noreorder
    addiu s0, s0 ,1
    li  s2, 0x0
###test inst
    TEST_BLTZ(0x9e0d7d08, 0x933a7610, 0xee034360, 0x933a7610, 0xee034360)
    TEST_BLTZ(0x9d459300, 0x0f16b74f, 0x686b1250, 0x0f16b74f, 0x686b1250)
    TEST_BLTZ(0xf98d5680, 0xf8a37ee5, 0x61e96814, 0xf8a37ee5, 0x61e96814)
    TEST_BLTZ(0xcf6684e0, 0x39f59b62, 0x23c98d99, 0x39f59b62, 0x23c98d99)
    TEST_BLTZ(0xfff90290, 0x6a2f7d7c, 0xc275fd82, 0x6a2f7d7c, 0xc275fd82)
    TEST_BLTZ(0x35ae8150, 0x291a3374, 0x60d28110, 0x00000000, 0x00000000)
    TEST_BLTZ(0xad6ec7b4, 0xb861ba80, 0x480dae66, 0xb861ba80, 0x480dae66)
    TEST_BLTZ(0x0d862630, 0x26c4c128, 0xa2a64340, 0x00000000, 0x00000000)
    TEST_BLTZ(0x19d4b730, 0xc02c3d48, 0x82d09792, 0x00000000, 0x00000000)
    TEST_BLTZ(0x735f7026, 0x761f36aa, 0x58094d78, 0x00000000, 0x00000000)
    TEST_BLTZ(0xa22e5194, 0x0d774c5c, 0x02b23fb0, 0x0d774c5c, 0x02b23fb0)
    TEST_BLTZ(0xa810d7b5, 0x0cd95b8c, 0x9affb004, 0x0cd95b8c, 0x9affb004)
    TEST_BLTZ(0x3f58d900, 0xf9a33110, 0x82cdf204, 0x00000000, 0x00000000)
    TEST_BLTZ(0x9e431baa, 0xf2ba053c, 0x20d4b030, 0xf2ba053c, 0x20d4b030)
    TEST_BLTZ(0xb541b79a, 0xcf79696e, 0xdcd50e00, 0xcf79696e, 0xdcd50e00)
    TEST_BLTZ(0x834c2020, 0x2c883e20, 0xe15bff7c, 0x2c883e20, 0xe15bff7c)
    TEST_BLTZ(0x0b797cdc, 0x7343996a, 0xb90ca064, 0x00000000, 0x00000000)
    TEST_BLTZ(0x962a45f8, 0x5444e1a0, 0x3e830400, 0x5444e1a0, 0x3e830400)
    TEST_BLTZ(0xf5a64820, 0xd1bee2c0, 0x89008130, 0xd1bee2c0, 0x89008130)
    TEST_BLTZ(0xd0c57308, 0x197e96a8, 0x398e59dc, 0x197e96a8, 0x398e59dc)
    TEST_BLTZ(0x802bce60, 0x9bf370aa, 0xfc5d24b8, 0x9bf370aa, 0xfc5d24b8)
    TEST_BLTZ(0x0ca64003, 0x1c3d27ba, 0x64d7f4c2, 0x00000000, 0x00000000)
    TEST_BLTZ(0xb418df98, 0x1370d877, 0x86f76c50, 0x1370d877, 0x86f76c50)
    TEST_BLTZ(0x04b8fd80, 0x187a7fa0, 0xa6a75f45, 0x00000000, 0x00000000)
    TEST_BLTZ(0x8c7a540a, 0xb6a4aa54, 0xfd289d08, 0xb6a4aa54, 0xfd289d08)
    TEST_BLTZ(0x29d13168, 0x2d313870, 0x7e3b2a5c, 0x00000000, 0x00000000)
    TEST_BLTZ(0x847c1c31, 0xc7d9e5e0, 0xe5dfcb74, 0xc7d9e5e0, 0xe5dfcb74)
    TEST_BLTZ(0xbc68c0b3, 0x19067280, 0x6622b824, 0x19067280, 0x6622b824)
    TEST_BLTZ(0xc89afa42, 0x98397888, 0x3bef4814, 0x98397888, 0x3bef4814)
    TEST_BLTZ(0xeb721458, 0x3499da1a, 0x0db72217, 0x3499da1a, 0x0db72217)
    TEST_BLTZ(0x370d8474, 0xc86a8a68, 0xb2b4cbc0, 0x00000000, 0x00000000)
    TEST_BLTZ(0xbac95a80, 0x35228984, 0x8e187210, 0x35228984, 0x8e187210)
    TEST_BLTZ(0xfc606368, 0x9c993ef6, 0xd1d9c170, 0x9c993ef6, 0xd1d9c170)
    TEST_BLTZ(0xd3aa9850, 0x2a34ebe0, 0x2b454d30, 0x2a34ebe0, 0x2b454d30)
    TEST_BLTZ(0x58185fe8, 0xdc8aca06, 0x9b1fc024, 0x00000000, 0x00000000)
    TEST_BLTZ(0x76e44284, 0x9c95c54e, 0x4c8f4d10, 0x00000000, 0x00000000)
    TEST_BLTZ(0xed953f80, 0xf959a600, 0x3695bd49, 0xf959a600, 0x3695bd49)
    TEST_BLTZ(0x6337ad50, 0x234da0c0, 0xbcd7f8dc, 0x00000000, 0x00000000)
    TEST_BLTZ(0x9c2d2880, 0x0fb6a53c, 0xbe709a00, 0x0fb6a53c, 0xbe709a00)
    TEST_BLTZ(0x9c285348, 0x76552200, 0x71def7ea, 0x76552200, 0x71def7ea)
    TEST_BLTZ(0x85ed8d20, 0xd8f3a680, 0x49c5fb92, 0xd8f3a680, 0x49c5fb92)
    TEST_BLTZ(0xd5a719d8, 0x751d23bc, 0x18b9aa1c, 0x751d23bc, 0x18b9aa1c)
    TEST_BLTZ(0x6af71036, 0x442ef2d8, 0xc49025b4, 0x00000000, 0x00000000)
    TEST_BLTZ(0xea962a7c, 0x0191e080, 0x642e4740, 0x0191e080, 0x642e4740)
    TEST_BLTZ(0x47aec030, 0xe5ab6ce8, 0x6acc6cd0, 0x00000000, 0x00000000)
    TEST_BLTZ(0xf3a948e6, 0x1e2378ee, 0x127ccd50, 0x1e2378ee, 0x127ccd50)
    TEST_BLTZ(0x4e079da0, 0x41f8f4b8, 0xe980da38, 0x00000000, 0x00000000)
    TEST_BLTZ(0xe1fa6bc0, 0xd02108c0, 0x416f6238, 0xd02108c0, 0x416f6238)
    TEST_BLTZ(0x7ebcf3bc, 0x9c4cc2dc, 0x6cdf9664, 0x00000000, 0x00000000)
    TEST_BLTZ(0x4752405d, 0x27c6a7a0, 0xa780a0d0, 0x00000000, 0x00000000)
    TEST_BLTZ(0x0cfd2a00, 0x75d6df00, 0x9c8a095e, 0x00000000, 0x00000000)
    TEST_BLTZ(0xeab5a598, 0x81136168, 0x73d850ad, 0x81136168, 0x73d850ad)
    TEST_BLTZ(0x327fd3c0, 0xe2fa74c4, 0x45c49600, 0x00000000, 0x00000000)
    TEST_BLTZ(0xafb62550, 0xcbd20698, 0x24e99b20, 0xcbd20698, 0x24e99b20)
    TEST_BLTZ(0x0dc03c69, 0xb3b525bd, 0xe917066a, 0x00000000, 0x00000000)
    TEST_BLTZ(0x78e213c8, 0xa5f2a950, 0xe5112d82, 0x00000000, 0x00000000)
    TEST_BLTZ(0xe981ebd4, 0x2dfde0f8, 0xe0efd180, 0x2dfde0f8, 0xe0efd180)
    TEST_BLTZ(0x8b1bd002, 0xcbe8adea, 0x19c129ac, 0xcbe8adea, 0x19c129ac)
    TEST_BLTZ(0x2a9f7c7a, 0x5167be58, 0x6baa804c, 0x00000000, 0x00000000)
    TEST_BLTZ(0x37420a60, 0x70382f80, 0x9078aa46, 0x00000000, 0x00000000)
    TEST_BLTZ(0xf242e600, 0x1642c61c, 0xa38d2e80, 0x1642c61c, 0xa38d2e80)
    TEST_BLTZ(0x4516dde0, 0x2e48da70, 0xf45cd83c, 0x00000000, 0x00000000)
    TEST_BLTZ(0x65b5bef8, 0x6e9d5cda, 0x5a8d1dfe, 0x00000000, 0x00000000)
    TEST_BLTZ(0xd6e6b0ce, 0x2ef6ffb2, 0xb22d5dd0, 0x2ef6ffb2, 0xb22d5dd0)
    TEST_BLTZ(0x62be96bc, 0xe46f4670, 0xc9e54029, 0x00000000, 0x00000000)
    TEST_BLTZ(0x4aa84010, 0x3b7778a8, 0xf2bae330, 0x00000000, 0x00000000)
    TEST_BLTZ(0xa5943217, 0xd8303018, 0xb12cd314, 0xd8303018, 0xb12cd314)
    TEST_BLTZ(0xff884480, 0x979930dc, 0xfa058170, 0x979930dc, 0xfa058170)
    TEST_BLTZ(0xb7701bc6, 0xf7c61500, 0x0bbedddc, 0xf7c61500, 0x0bbedddc)
    TEST_BLTZ(0xcce1c6fc, 0x4a9ab34c, 0x7cb40e1c, 0x4a9ab34c, 0x7cb40e1c)
    TEST_BLTZ(0x43b2fbcc, 0x2af3319c, 0x53401ab0, 0x00000000, 0x00000000)
    TEST_BLTZ(0x2b3da200, 0x41f87d74, 0xf1041e93, 0x00000000, 0x00000000)
    TEST_BLTZ(0xe89ee957, 0x5dc7e9d6, 0xc9aff608, 0x5dc7e9d6, 0xc9aff608)
    TEST_BLTZ(0x6b5549a0, 0xbaa8e578, 0x2bbcae47, 0x00000000, 0x00000000)
    TEST_BLTZ(0x09e70922, 0x562b9778, 0xeb560a9c, 0x00000000, 0x00000000)
    TEST_BLTZ(0x8d56e0f2, 0x57ff0cf8, 0x73af1b80, 0x57ff0cf8, 0x73af1b80)
    TEST_BLTZ(0x103451f7, 0x61fcd0d4, 0x56061ea0, 0x00000000, 0x00000000)
    TEST_BLTZ(0x4a6fa38c, 0x3809112c, 0x289883b2, 0x00000000, 0x00000000)
    TEST_BLTZ(0xac335600, 0x9f2af260, 0x4a0f0974, 0x9f2af260, 0x4a0f0974)
    TEST_BLTZ(0x83ea3840, 0x9e5e8d3c, 0x20d6918a, 0x9e5e8d3c, 0x20d6918a)
    TEST_BLTZ(0xe1922ddb, 0xc1047530, 0xb0133970, 0xc1047530, 0xb0133970)
    TEST_BLTZ(0x37bce9a0, 0x4ac739fe, 0x0b1ac9d2, 0x00000000, 0x00000000)
    TEST_BLTZ(0x51787348, 0xec7ad2f0, 0x773995f6, 0x00000000, 0x00000000)
    TEST_BLTZ(0xff342a8a, 0xfcecadd0, 0x4ed43c1a, 0xfcecadd0, 0x4ed43c1a)
    TEST_BLTZ(0x4508a810, 0xe2b5fdd8, 0x92991dc6, 0x00000000, 0x00000000)
    TEST_BLTZ(0xc2c15004, 0xfc911f64, 0x2061c4d0, 0xfc911f64, 0x2061c4d0)
    TEST_BLTZ(0x6f274b3c, 0x3f1d95dc, 0xefe00ff0, 0x00000000, 0x00000000)
    TEST_BLTZ(0x157f97ce, 0xa298d40c, 0x2ba55f00, 0x00000000, 0x00000000)
    TEST_BLTZ(0x71410cd0, 0xbf4bea12, 0x2ce52246, 0x00000000, 0x00000000)
    TEST_BLTZ(0xee9153d0, 0x32abbeef, 0x9ef412d2, 0x32abbeef, 0x9ef412d2)
    TEST_BLTZ(0x8d848290, 0x4c782eb0, 0x3491e3fe, 0x4c782eb0, 0x3491e3fe)
    TEST_BLTZ(0x22094f88, 0xfceda322, 0x987ce552, 0x00000000, 0x00000000)
    TEST_BLTZ(0xdd5c4cdc, 0x9a9984f4, 0x95c7cfb8, 0x9a9984f4, 0x95c7cfb8)
    TEST_BLTZ(0x401bf5ce, 0x859ba710, 0xad5ef580, 0x00000000, 0x00000000)
    TEST_BLTZ(0x44a56676, 0xe31860dc, 0x4d43fd80, 0x00000000, 0x00000000)
    TEST_BLTZ(0x85b9de28, 0x190a1f10, 0xf22f43cc, 0x190a1f10, 0xf22f43cc)
    TEST_BLTZ(0x4ff32d84, 0xedf572fa, 0xf2cec4fc, 0x00000000, 0x00000000)
    TEST_BLTZ(0x31855688, 0x613bfc20, 0x880b8150, 0x00000000, 0x00000000)
    TEST_BLTZ(0xa086eaa2, 0x3fe0b906, 0x81b96b4a, 0x3fe0b906, 0x81b96b4a)
    TEST_BLTZ(0x4a9cf414, 0x2609357c, 0xce8abd3f, 0x00000000, 0x00000000)
    TEST_BLTZ(0xbadbbfac, 0x8dfaeaca, 0x36ee47e8, 0x8dfaeaca, 0x36ee47e8)
    TEST_BLTZ(0xe5d13dc0, 0x9471ebb8, 0xd6fd76d4, 0x9471ebb8, 0xd6fd76d4)
    TEST_BLTZ(0x632c5e60, 0x86e12e78, 0x659d7104, 0x00000000, 0x00000000)
    TEST_BLTZ(0xcf91a250, 0xaa94b69c, 0x2ac1f1d6, 0xaa94b69c, 0x2ac1f1d6)
    TEST_BLTZ(0x49d196fe, 0xfaa81f0a, 0xf9e1adb0, 0x00000000, 0x00000000)
    TEST_BLTZ(0x9ebe2784, 0x41bed444, 0x1652560f, 0x41bed444, 0x1652560f)
    TEST_BLTZ(0xb322d38c, 0x5b8221e0, 0x1289bca0, 0x5b8221e0, 0x1289bca0)
    TEST_BLTZ(0x11b95797, 0x8770cafc, 0x439ab537, 0x00000000, 0x00000000)
    TEST_BLTZ(0x4bb06da4, 0xccc5cb60, 0xd991fcb0, 0x00000000, 0x00000000)
    TEST_BLTZ(0x80a2b0e0, 0x55857404, 0x37f8d0f0, 0x55857404, 0x37f8d0f0)
    TEST_BLTZ(0x0872dd3e, 0x2e74626c, 0x17a65430, 0x00000000, 0x00000000)
    TEST_BLTZ(0x6a9e76e0, 0x9676e250, 0x755f53a0, 0x00000000, 0x00000000)
    TEST_BLTZ(0x27616458, 0xa3ef67c8, 0x9d588850, 0x00000000, 0x00000000)
    TEST_BLTZ(0x48cc05f0, 0x98517318, 0xb953e6ac, 0x00000000, 0x00000000)
    TEST_BLTZ(0xe0f05ce8, 0xb3326780, 0xd62c64ba, 0xb3326780, 0xd62c64ba)
    TEST_BLTZ(0xc5f375d0, 0x7ce6e8e8, 0x9a45b4e0, 0x7ce6e8e8, 0x9a45b4e0)
    TEST_BLTZ(0x0def6e32, 0xe2977d50, 0xd513c978, 0x00000000, 0x00000000)
    TEST_BLTZ(0xd2e68658, 0x7db1fbb0, 0x2785dae6, 0x7db1fbb0, 0x2785dae6)
    TEST_BLTZ(0x1905edb0, 0xc505eb80, 0x56c1479e, 0x00000000, 0x00000000)
    TEST_BLTZ(0xa9fd286c, 0x2938f462, 0x5faa7298, 0x2938f462, 0x5faa7298)
    TEST_BLTZ(0x34a53ea8, 0x42623100, 0x6fee4f64, 0x00000000, 0x00000000)
    TEST_BLTZ(0x52f93280, 0xe8c4474b, 0xca13b95f, 0x00000000, 0x00000000)
    TEST_BLTZ(0x91dd7060, 0x1881b730, 0x9f534bfa, 0x1881b730, 0x9f534bfa)
    TEST_BLTZ(0x51e636d8, 0x6c91d050, 0xa433dfcc, 0x00000000, 0x00000000)
    TEST_BLTZ(0x1d91f062, 0x88a0e79e, 0xd9f17580, 0x00000000, 0x00000000)
    TEST_BLTZ(0xe151c109, 0x44f39bec, 0x38c74868, 0x44f39bec, 0x38c74868)
    TEST_BLTZ(0xc93d6700, 0x96be756c, 0x1d8f3d83, 0x96be756c, 0x1d8f3d83)
    TEST_BLTZ(0xfc0fdece, 0xd7557eb4, 0x5be78000, 0xd7557eb4, 0x5be78000)
    TEST_BLTZ(0xfbe4a3b0, 0x7cf36c0a, 0xd39857d0, 0x7cf36c0a, 0xd39857d0)
    TEST_BLTZ(0x36018a74, 0x1ae73d80, 0xc31ea020, 0x00000000, 0x00000000)
    TEST_BLTZ(0xac7ce388, 0x5bb45c64, 0xb6c8267d, 0x5bb45c64, 0xb6c8267d)
    TEST_BLTZ(0x6649e200, 0xaa5490c4, 0x956e6b98, 0x00000000, 0x00000000)
    TEST_BLTZ(0xf9c28bef, 0xa3ff8230, 0xfe12c0f2, 0xa3ff8230, 0xfe12c0f2)
    TEST_BLTZ(0xb4151430, 0xc1666df6, 0x884428c0, 0xc1666df6, 0x884428c0)
    TEST_BLTZ(0x9d2fffdc, 0x1170e1c0, 0x4581cdba, 0x1170e1c0, 0x4581cdba)
    TEST_BLTZ(0xad58fd06, 0x7c88abf4, 0xc51574d6, 0x7c88abf4, 0xc51574d6)
    TEST_BLTZ(0xf6182edd, 0xc2136700, 0xffa6f314, 0xc2136700, 0xffa6f314)
    TEST_BLTZ(0x084d6082, 0x19f95918, 0x50572e1d, 0x00000000, 0x00000000)
    TEST_BLTZ(0xd84a2ada, 0x2fe0c760, 0x77d6d4e8, 0x2fe0c760, 0x77d6d4e8)
    TEST_BLTZ(0x80dd7048, 0xa00915a8, 0x7049d94a, 0xa00915a8, 0x7049d94a)
    TEST_BLTZ(0x4001558e, 0x34561259, 0xd713845e, 0x00000000, 0x00000000)
    TEST_BLTZ(0x1e0ba344, 0xbdcc8f44, 0xea13b732, 0x00000000, 0x00000000)
    TEST_BLTZ(0xadc62fa0, 0x66fef41f, 0x98a0ce08, 0x66fef41f, 0x98a0ce08)
    TEST_BLTZ(0x64e0d7d2, 0xb2d5538c, 0x9eea574c, 0x00000000, 0x00000000)
    TEST_BLTZ(0x50eb3284, 0xbdd2d88f, 0x20c9711c, 0x00000000, 0x00000000)
    TEST_BLTZ(0x9cb06f0b, 0x83e6c124, 0x0e42efa4, 0x83e6c124, 0x0e42efa4)
    TEST_BLTZ(0xd6dc7dde, 0xc019d540, 0xffaecc98, 0xc019d540, 0xffaecc98)
    TEST_BLTZ(0x70ca1af8, 0x2dba7b70, 0xdba141b0, 0x00000000, 0x00000000)
    TEST_BLTZ(0x733f61a6, 0xc841c5c8, 0xe3f82434, 0x00000000, 0x00000000)
    TEST_BLTZ(0xf5969546, 0x18389fc2, 0xeb9542c8, 0x18389fc2, 0xeb9542c8)
    TEST_BLTZ(0x09706a87, 0x07da9480, 0x11a59570, 0x00000000, 0x00000000)
    TEST_BLTZ(0x278f97e0, 0x42f98793, 0xdd565344, 0x00000000, 0x00000000)
    TEST_BLTZ(0x00000000, 0x5f7d6c5f, 0x632c31aa, 0x00000000, 0x00000000)
###detect exception
    bne s2, zero, inst_error
    nop
###score ++
    addiu s3, s3, 1
###output (s0<<24)|s3
inst_error:  
    sll t1, s0, 24
    or t0, t1, s3 
    sw t0, 0(s1)
    jr ra
    nop
END(n47_bltz_test)
